<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width = device-width, initial-scale = 1.0, minimum-scale = 1.0, maximum-scale = 1.0, user-scalable = no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<title>订单详情</title>
<link type="text/css" href="../css/reset.css" rel="stylesheet" />
<link type="text/css" href="../css/public.css" rel="stylesheet" />
<link type="text/css" href="../css/style.css" rel="stylesheet" />
<link type="text/css" href="../css/wode.css" rel="stylesheet" />
<script>
    var deviceWidth = Math.min(640, window.innerWidth)
    document.documentElement.style.fontSize = deviceWidth / 7.5 + "px"
</script>
<script src="../js/jquery.min.js?v=2.1.4"></script>
<script src="../js/core.js"></script>
<script src="../js/12.8.1buydingdandaifukuan.js"></script>
</head>

<body>
<!-- top -->
<div class="header">
    <header class="p_header public-red">
        <a href="javascript:history.go(-1);" class="p_header_left">
            <i class="p_left" title="返回"></i>
        </a>
        <h1 class="p_dizhi">订单详情</h1>
    </header>
</div>
<!--订单详情-->
<!--时间-->
<div class="buy_dingdan_time">
	<h6>订单将在<span id="shi"></span>小时<span id="fen"></span>分钟后自动关闭</h6>
</div>
<!--地址-->
<div class="detail_dizhi clearfix" id="dizhi">
  
</div>
<div class="public-jianxi"></div>
<!--内容-->
<div class="detail_goods clearfix" style="margin-bottom: 0;">
    <h4 id="shopnaem"></h4>
    <div id="neirong">
    	
    </div>
    <!--<div class="detail_goods_peisong">优惠券<span>包邮</span>
    </div>-->
   <div class="detail_goods_peisong">配送方式<span id="peisong">包邮</span>
    </div>
    <div class="detail_goods_liuyan">买家留言：<span id="liuyan">未填写</span></div>
    <div class="detail_goods_zhifu">
        <span>共计<i id="shangshuliang"></i>件商品</span>
        <span>合计：<i id="heji"></i></span>
    </div>
</div>
</div>

<div class="public-jianxi"></div>
<div class="dingdan_title">费用明细</div>
<div class="detail_feiyong">
    <ul id="feiyongmingxi">
    </ul>
    <div class="detail_feiyong_zong">实付金额<span id="shifujine"></span></div>
</div>
<div class="dingdan_title">订单信息</div>
<div class="buy_dingdan_xinxi">
    <ul id="dingdanxingxi">
    </ul>
</div>
<input type="hidden" id="shijian"/>
<div class="public-jianxi"></div>
<!--footer-->
<div class="buy_detail_footer">
	<div class="buy_detail_footer_con">
		<div class="fr" id="fukuans">
			
		</div>
	</div>
</div>
<input type="hidden" id="biaohaos"/>
<!-- 取消订单 -->
<div class="show1 show-quxiao">
    <h2>取消订单提示</h2>
    <p>你确认要取消订单吗？</p>
    <ul>
        <li>
            <span class="Quxiao" onclick="querenquxiao()">确认</span>
        </li>
        <li>
            <em class="Quxiao">取消</em>
        </li>
    </ul>
</div>

<script type="text/javascript" src="../js/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
    // 取消订单
    // 弹出
  
</script>
<script>
	
	// 日期，在原有日期基础上，增加days天数，默认增加1天
        function addDate(date, days) {
            if (days == undefined || days == '') {
                days = 1;
            }
            var dates = new Date(date);
            dates.setDate(dates.getDate() + days);
         /*   var month = date.getMonth() + 1;
            var day = date.getDate();
            var HH=date.getHours();
            var dd=date.getMinutes();
            var ss=date.getSeconds();*/
           
    return dates;
        }

        // 日期月份/天的显示，如果是1位数，则在前面加上'0'
        function getFormatDate(arg) {
            if (arg == undefined || arg == '') {
                return '';
            }

            var re = arg + '';
            if (re.length < 2) {
                re = '0' + re;
            }

            return re;
        }
	
	//计时器
    window.onload=function(){      
      getMyTime(); 
    }
    //1.前面补0
    function p(n){
      return n<10?'0'+n:n;
    }
    //2.倒计时
    function getMyTime(){      
      var startDate=new Date();
      var a=$("#shijian").val();
     
      var b = addDate(a,1);
      //alert(".."+b)
      //var endDate=new Date(b);
      var countDown=(b.getTime()-startDate.getTime())/1000;
      //var day=parseInt(countDown/(24*60*60));//天
      var h=parseInt(countDown/(60*60)%24);
      var m=parseInt(countDown/60%60);
     // var s=parseInt(countDown%60);        
     
      document.getElementById('shi').innerHTML=p(h);
      document.getElementById('fen').innerHTML=p(m);
      setTimeout('getMyTime()',500);
      if(countDown<=0){
      	  

	 if(getvl("id")==''){
	
	 }else{
   	  $.ajax({
      url: urlcore+"/api/order/updataorders?id="+getvl("id")+"&status=2",
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
						window.location.href = document.referrer;
					//selectGoodsList2();
					//var dangqian=window.location.href;
					//window.location.href=dangqian;
				//  alert("取消成功");
				  	 
				}
		/*console.log(goodslist);*/
			},
			error: function() {
				alert("error");
			}
		});
}
	 
	 

      	  
      }
    }	
	
</script>


</body>
</html>